package ObjectDemo;

interface IMessage {
    void getMessage();
}

class MessageImpl implements IMessage {
    @Override
    public String toString() {
        return "I am small biter";
    }

    public void getMessage() {
        System.out.println("比特欢迎你");
    }
}

public class Test {
    public static void main(String[] args) {
        IMessage msg = new MessageImpl(); // 子类向父接口转型
        Object obj = msg; // 接口向Obejct转型
        System.out.println(obj);
        IMessage temp = (IMessage) obj; // 强制类型转换
        temp.getMessage();
    }
}